package com.cax.module.file.domain;


import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import lombok.Getter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 文件类型表 实体
 * @author makejava
 * @date 2024-06-11 16:43:57
 */
@Data
@Accessors(chain = true)
@TableName("file_type")
@ApiModel(value = "FileType", description = "文件类型表")
public class FileType extends Model<FileType> implements Serializable {
	private static final long serialVersionUID = 567507579585286876L;

    @ApiModelProperty(value = "文件类型表-主键id 一个层级占用两位数 例如第一层级是10 第二层级就是1000 第三层级就是100000")
	@TableId(value = "id", type = IdType.AUTO)
    private Integer id;

	@ApiModelProperty(value = "编码集")
	@TableField("`codes`")
    private String codes;

	@ApiModelProperty(value = "名称")
	@TableField("`name`")
    private String name;

	@ApiModelProperty(value = "备注")
	@TableField("`remark`")
    private String remark;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@TableField("`create_time`")
    private LocalDateTime createTime;

	/**
	 * 文件业务类型枚举
	 * 枚举数据来源表file_type
	 */
	@Getter
	public enum TypeEnum{
		FILE_TYPE_1(1,"文章-标题图片"),
		FILE_TYPE_2(2,"文章-内容中的富文本文件"),
		FILE_TYPE_3(3,"企业证书-证书图片"),
		FILE_TYPE_4(4,"能力评价-培训合格证证书图片");

		private final Integer code;
		private final String name;

		TypeEnum(
				Integer code,
				String name
		){
			this.code = code;
			this.name = name;
		}
	}
}

